<?php
/**
 * Created by PhpStorm.
 * User: hcadmin
 * Date: 16/8/30
 * Time: 下午4:49
 */
use app\assets\AppAsset;
use yii\helpers\Html;

AppAsset::register($this);
$base = Yii::$app->request->baseUrl;
AppAsset::addCss($this,$base . '/app/css/layout.css?V=0.0.5');
AppAsset::addScript($this,$base . '/app/js/net-util.js');

AppAsset::addScript($this, 'https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js');

$admin = isset($_COOKIE['admin_id'])?$_COOKIE['admin_id']:-1;
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <script type="text/javascript">
        $('body').css('font-family','Microsoft YaHei');
        //页面大小出现变化的时候再次获取新的font-size值
        $(window).resize(function(){

            setHtmlFontSize(1920);

        });
        //初始化执行
        setHtmlFontSize(1920);

        //动态设置html元素的font-size的方法
        function setHtmlFontSize(num){
            //页面的宽度，其中17为页面默认的导航条的宽度
            var _w=document.documentElement.clientWidth-17;
            var fontSize = 12*_w/num;
            if (fontSize<12)
                fontSize = 12;
            $('html').css('fontSize',fontSize);
        }
    </script>
</head>
<body>
<?php $this->beginBody() ?>
<div class="content" id="content">

    <div style="min-width: 64rem;width: 100rem;min-height: 100rem;z-index: 0;position: absolute;">

        <div class="top-menu">
            <span class="exit" id="search_id" style="cursor: pointer;"  onclick="loginOut()">退出</span>
        </div>

        <div class="container" style="width: 23.3rem;min-height: 100rem;float: left;padding: 0 ;background-color:#2C3031;z-index: 2;">
            <div style="width: 23.33rem;height: 20.83rem;">
                <img style="width: 23.33rem;height: 20.83rem;" src="<?= $base?>/app/images/new/rc_icon_leftbar_logo.png">
            </div>
            <div  style="margin-left: auto;margin-right: auto;width: 23.3rem">
                <div id="demo" style="width: 23.3rem;z-index:0;min-height: 80rem;background-color: #2C3031 ">
                    <?php $menuitemid = $this->params['menuitemid']?>

                    <div class="list">
                        <ul class="yiji">

                            <li><a href="javascript:void(0)" class="inactive"><img id="171" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">商家管理</a>
                                <ul>
                                    <li><a id="172" href="bar-list">酒吧列表</a></li>
                                </ul>

                                <ul>
                                    <li><a id="173" href="merchant-entry">商家入驻申请</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="111" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">用户管理</a>
                                <ul>
                                    <li><a id="112" href="user-list">用户列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="181" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">动态管理</a>
                                <ul>
                                    <li><a id="182" href="dynamic-list">动态列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="161" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">马甲管理</a>
                                <ul>
                                    <li><a id="162" href="vest-list">马甲列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="141" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">充值记录</a>
                                <ul>
                                    <li><a id="142" href="pay-list">充值列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="131" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">举报管理</a>
                                <ul>
                                    <li><a id="132" href="report-list">举报列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="121" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">意见管理</a>
                                <ul>
                                    <li><a id="122" href="feedback-list">意见列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="151" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">派对管理</a>
                                <ul>
                                    <li><a id="152" href="party-list">派对列表</a></li>
                                </ul>
                            </li>

                            <li><a href="javascript:void(0)" class="inactive"><img id="101" class="icon" src="<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png">系统设置</a>
                                <ul>
                                    <li><a id="102" href="gift-list">礼物设置</a></li>
                                </ul>

                                <ul>
                                    <li><a id="103" href="staff-list">员工设置</a></li>
                                </ul>

                                <ul>
                                    <li><a id="104" href="banner-list">广告设置</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div style="float: left;width: 75.9rem;height: 100rem;">
            <div class="cui-bubble-layer" id="confirm_dialog"  tabindex="0" style="outline:none;position: absolute;display: none;z-index:5">
                <div id="confirm_title" style="margin-left: 1.3rem;font-size: 1rem">确定删除该账号吗？</div>
                <div>
                    <div id="confirm_id" class="confirmBtn">确定</div>
                    <div id="cancel_id" class="cancelBtn">取消</div>
                </div>
            </div>
            <?= $content ?>
        </div>

        <div class="loading-area" hidden="hidden">
            <img class="loading" src="<?= $base?>/app/images/loader_spinner.gif">
        </div>

        <div class="choose-area" hidden="hidden">
            <div class="choose-pic" id="choose-pic">
                <div style="width: 100%">
                    <label>请选择图片</label>
                    <img class="myClose" src="<?= $base?>/app/images/close.png">
                </div>
                <button class="select-img">选择图片</button>
                <div class="pic-area">
                    <img class="pic-area-img" id="pic-area-img" >
                </div>
                <div>
                    <input type="hidden" id="x" name="x">
                    <input type="hidden" id="y" name="y">
                    <input type="hidden" id="w" name="w">
                    <input type="hidden" id="h" name="h">
                    <button class="upload-img">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var menuitemid = parseInt('<?= $menuitemid?>');
    var oldId = menuitemid;
    itemActive(menuitemid);

    function loginOut(){
        if(confirm('确认退出?'))
            location.href = 'login-out';
    }
    $('.exit').mousedown(function () {
        $('.exit').attr('src', '<?=$base?>/app/images/exit-selected.png');
    });

    $('.exit').mouseup(function () {
        $('.exit').attr('src', '<?=$base?>/app/images/exit-unselected.png');
    });

$(document).ready(function() {
    $('.inactive').click(function(){
        var className=$(this).parents('li').parents().attr('class');
        var id=$(this).children('img').attr('id');
        if($(this).siblings('ul').css('display')=='none'){

            if(className=="yiji"){
                itemUnActive(parseInt(oldId));
                $(this).parents('li').siblings('li').children('ul').parent('li').children('a').removeClass('inactives');
                $(this).parents('li').siblings('li').children('ul').slideUp(200);

            }

//            $(this).addClass('inactives');
            $(this).siblings('ul').slideDown(200).children('li');

            itemActive(parseInt(id));
        }else {
            itemUnActive(parseInt(id));
            $(this).removeClass('inactives');
            $(this).siblings('ul').slideUp(200);
        }

        oldId = id;
    })
});

    function itemActive(id){
        if(id < 10){
            $('#1').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#1').parent('a').css('color','#DCB76E');

            $('#1').parent('a').siblings('ul').show();
            $('#1').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 20 && id >= 10){
            $('#11').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_interaction_management_s.png');
            $('#11').parent('a').css('color','#DCB76E');

        }else if(id < 30 && id >= 20){
            $('#21').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_consumption_management_s.png');
            $('#21').parent('a').css('color','#DCB76E');

        }else if(id < 40 && id >= 30){
            $('#31').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_recharge_management_s.png');
            $('#31').parent('a').css('color','#DCB76E');

            $('#31').parent('a').siblings('ul').show();
            $('#31').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 50 && id >= 40){
            $('#41').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_charts_management_s.png');
            $('#41').parent('a').css('color','#DCB76E');

            $('#41').parent('a').siblings('ul').show();
            $('#41').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 60 && id >= 50){
            $('#51').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_business_management_s.png');
            $('#51').parent('a').css('color','#DCB76E');
        }else if(id < 70 && id >= 60){
            $('#61').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_user_management_s.png');
            $('#61').parent('a').css('color','#DCB76E');

            $('#61').parent('a').siblings('ul').show();
            $('#61').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 80 && id >= 70){
            $('#71').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_account_management_s.png');
            $('#71').parent('a').css('color','#DCB76E');

            $('#71').parent('a').siblings('ul').show();
            $('#71').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 90 && id >= 80){
            $('#81').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_feedback_s.png');
            $('#81').parent('a').css('color','#DCB76E');

        }else if(id < 100 && id >= 90){
            $('#91').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_notice_management_s.png');
            $('#91').parent('a').css('color','#DCB76E');

            $('#91').parent('a').siblings('ul').show();
            $('#91').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 110 && id >= 100){
            $('#101').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_chat_management_s.png');
            $('#101').parent('a').css('color','#DCB76E');

            $('#101').parent('a').siblings('ul').show();
            $('#101').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 120 && id >= 110){
            $('#111').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_ticket_management_s.png');
            $('#111').parent('a').css('color','#DCB76E');

            $('#111').parent('a').siblings('ul').show();
            $('#111').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 130 && id >= 121){
            $('#121').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_signba_s.png');
            $('#121').parent('a').css('color','#DCB76E');

            $('#121').parent('a').siblings('ul').show();
            $('#121').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 140 && id >= 131){
            $('#131').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#131').parent('a').css('color','#DCB76E');

            $('#131').parent('a').siblings('ul').show();
            $('#131').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 150 && id >= 141){
            $('#141').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#141').parent('a').css('color','#DCB76E');

            $('#141').parent('a').siblings('ul').show();
            $('#141').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 160 && id >= 151){
            $('#151').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#151').parent('a').css('color','#DCB76E');

            $('#151').parent('a').siblings('ul').show();
            $('#151').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 170 && id >= 161){
            $('#161').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#161').parent('a').css('color','#DCB76E');

            $('#161').parent('a').siblings('ul').show();
            $('#161').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }else if(id < 180 && id >= 171){
            $('#171').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#171').parent('a').css('color','#DCB76E');

            $('#171').parent('a').siblings('ul').show();
            $('#171').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');
        }else if(id < 190 && id >= 181){
            $('#181').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_s.png');
            $('#181').parent('a').css('color','#DCB76E');

            $('#181').parent('a').siblings('ul').show();
            $('#181').parent('a').addClass('inactives');
            $('#'+id).css('color','#FFFFFF');

        }

        var url = window.location.href;
        if(url.indexOf("coupon-management") >= 0){
            $('#demo').css('min-height','114rem');
        }else if(url.indexOf("interactive-manager") >= 0){
            $('#demo').css('min-height','160rem');
        }else if(url.indexOf("message-manager") >= 0){
            $('#demo').css('min-height','85rem');
        }else{
            $('#demo').css('min-height','80rem');
        }
    }

    function itemUnActive(id){
        if(id < 10){
            $('#1').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#1').parent('a').css('color','#78797B');
        }else if(id < 20 && id >= 10){
            $('#11').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_interaction_management_n.png');
            $('#11').parent('a').css('color','#78797B');
        }else if(id < 30 && id >= 20){
            $('#21').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_consumption_management_n.png');
            $('#21').parent('a').css('color','#78797B');
        }else if(id < 40 && id >= 30){
            $('#31').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_recharge_management_n.png');
            $('#31').parent('a').css('color','#78797B');
        }else if(id < 50 && id >= 40){
            $('#41').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_charts_management_n.png');
            $('#41').parent('a').css('color','#78797B');
        }else if(id < 60 && id >= 50){
            $('#51').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_business_management_n.png');
            $('#51').parent('a').css('color','#78797B');
        }else if(id < 70 && id >= 60){
            $('#61').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_user_management_n.png');
            $('#61').parent('a').css('color','#78797B');
        }else if(id < 80 && id >= 70){
            $('#71').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_account_management_n.png');
            $('#71').parent('a').css('color','#78797B');
        }else if(id < 90 && id >= 80){
            $('#81').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_feedback_n.png');
            $('#81').parent('a').css('color','#78797B');
        }else if(id < 100 && id >= 90){
            $('#91').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_notice_management_n.png');
            $('#91').parent('a').css('color','#78797B');
        }else if(id < 110 && id >= 100){
            $('#101').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_chat_management_n.png');
            $('#101').parent('a').css('color','#78797B');
        }else if(id < 120 && id >= 110){
            $('#111').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_ticket_management_n.png');
            $('#111').parent('a').css('color','#78797B');
        }else if(id < 130 && id >= 121){
            $('#121').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_signba_n.png');
            $('#121').parent('a').css('color','#78797B');
        }else if(id < 140 && id >= 131){
            $('#131').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#131').parent('a').css('color','#78797B');
        }else if(id < 150 && id >= 141){
            $('#141').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#141').parent('a').css('color','#78797B');
        }else if(id < 160 && id >= 151){
            $('#151').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#151').parent('a').css('color','#78797B');
        }else if(id < 170 && id >= 161){
            $('#161').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#161').parent('a').css('color','#78797B');
        }else if(id < 180 && id >= 171){
            $('#171').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#171').parent('a').css('color','#78797B');
        }else if(id < 190 && id >= 181){
            $('#181').attr('src','<?=$base?>/app/images/new/rc_icon_leftbar_overview_n.png');
            $('#181').parent('a').css('color','#78797B');
        }
    }
</script>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>